<template>
  <div>=={{n}}
 <input  type="button" @click="say()" value="btn"/>

 <h1 v-if="flag">{{flag}}</h1>
  </div>
</template>

<script>
import {ref}  from  'vue'

export default {
  setup () {
    // var n=1
    var n=ref(1)
    var flag=ref(true)
    
    const say = () => {
      n.value+=1
     console.log(flag);
     flag.value=!flag.value
    }
    return {n,say,flag}
  }
}
</script>

<style lang="scss" scoped>

</style>